import http from '../../utils/request/request'

// 获取数据（分类）
export function getAllInfoByPage(current, size) {
    return http({
        url: `/breed/farming-operate/${current}/${size}`,
        method: 'get',
    })
}
// 根据操作名称搜索养殖操作
export function searchOperateKeyword(current, size, name) {
    return http({
        url: `/breed/farming-operate/${name}/${current}/${size}`,
        method: 'get'
    })
}

// 创建养殖操作 "baseId": 0,"name": "string","type": "string","useStatus": "string"
export function newFarmingOperate(data) {
    return http({
        url: `/breed/farming-operate`,
        method: 'post',
        data: data
    })
}

// 编辑生产档案 id:0 "baseId": 0,"name": "string","type": "string","useStatus": "string"
export function editFarmingOperate(data) {
    return http({
        url: `/breed/farming-operate`,
        method: 'put',
        data: data
    })
}

// 删除多个养殖操作
export function delFarmingOperate(ids) {
    return http({
        url: `/breed/farming-operate/batch`,
        method: 'delete',
        data: ids
    })
}

// 删除单个养殖操作
export function delOneFarmingOperate(id) {
    return http({
        url: `/breed/farming-operate/${id}`,
        method: 'delete',
    })
}

// 禁用养殖操作
export function closeFarmingOperate(id) {
    return http({
        url: `/breed/farming-operate/closeOperate/${id}`,
        method: 'put',
    })
}

// 启用养殖操作
export function openFarmingOperate(id) {
    return http({
        url: `/breed/farming-operate/openOperate/${id}`,
        method: 'put'
    })
}

// 获取养殖操作选择器数据
export function getFarmingOperateOptions() {
    return http({
        url: `/breed/farming-operate/map`,
        method: 'get'
    })
}